<template>
  <el-dialog
    class="modify-class"
    width="500px"
    title="变更概述详情"
    visible
    append-to-body
    :close-on-click-modal="false"
    :before-close="beforeClose"
  >
  <!-- popper-class="table-select-poppper" -->
  <el-form class="modify-form mt20" :model="formData">
    <el-form-item prop="changeDescribe">
      <el-input
        class="desc-input"
        type="textarea"
        v-model="formData.changeDescribe"
        :rows="6"
        placeholder="请输入变更概述详情"
      />
    </el-form-item>
  </el-form>
  <div class="dialog-footer" slot="footer">
    <el-button class="btn-comfirm" type="primary" @click="saveHandle">确认</el-button>
    <el-button class="btn-cancel" @click="cancelHandle">取消</el-button>
  </div>
  </el-dialog>
</template>

<script>
import technologyApi from '@/apis/overview/technology.js'

export default {
  props: ['introData'],
  data() {
    return {
      formData: {
        changeDescribe: this.introData.changeDescribe
      }
    }
  },
  methods: {
    close(changeDescribe) {
      this.$emit("close", changeDescribe);
    },
    beforeClose() {
      this.close();
    },
    saveHandle() {
      const {id, type} = this.introData
      technologyApi.technologyUpdate({
        id,
        changeDescribe: this.formData.changeDescribe,
        type: type.code
      }).then(() => {
        this.$message.success('保存成功')
        this.close(this.formData.changeDescribe)
      })
    },
    cancelHandle() {
      this.close()
    }
  }
}
</script>

<style>

</style>